<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function count(num1, c, num2) {
        switch (c) {
          case "+":
            alert(`结果为：${num1 + num2}`)
            break
        }
        switch (c) {
          case "-":
            alert(`结果为：${num1 - num2}`)
            break
        }
        switch (c) {
          case "*":
            alert(`结果为：${num1 * num2}`)
            break
        }
        switch (c) {
          case "/":
            alert(`结果为：${num1 / num2}`)
            break
        }
      }
      alert("小计算器")
      count(
        Number(prompt("请输入第一个数：")),
        prompt("要进行的运算："),
        Number(prompt("请输入第二个数："))
      )
    </script>
  </body>
</html>
